package csc.fresher.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import csc.fresher.dao.AccountOverallDao;
import csc.fresher.dao.DepositAccountDao;
import csc.fresher.entity.CustomerAccount;
import csc.fresher.entity.CustomerAccountOverall;
import csc.fresher.entity.DepositAccount;
import csc.fresher.service.DepositAccountService;

@Service
public class DepositAccountServiceImpl implements DepositAccountService {

	@Autowired
	DepositAccountDao depositAccountDao;

	@Autowired
	AccountOverallDao accountOverallDao;

	@Override
	public DepositAccount getDepositAccountByDepositAccountID(long id) {
		return depositAccountDao.getDepositAccountByDepositAccountID(id);
	}

	@Override
	public long create(DepositAccount depositAccount) {
		return depositAccountDao.create(depositAccount);
	}

	@Override
	public boolean update(DepositAccount depositAccount) {
		return depositAccountDao.update(depositAccount);
	}

	@Override
	public boolean delete(DepositAccount depositAccount) {
		return depositAccountDao.delete(depositAccount);
	}

	@Override
	public void getAccountBalance(DepositAccount depositAccount) {
		depositAccountDao.getAccountBalance(depositAccount);
	}

	@Override
	public List<CustomerAccount> getAccountByCustomerID(long customerID) {
		return depositAccountDao.getAccountByCustomerID(customerID);
	}

	// Nghia
	@Override
	public List<CustomerAccountOverall> getAccountByState(String accountState,
			String accountType) {
		return accountOverallDao.getAccountByState(accountState, accountType);
	}

	@Override
	public List<CustomerAccountOverall> getAccountByIDCardNumber(
			long idCardNumber, String accountType) {
		return accountOverallDao.getAccountByIDCardNumber(idCardNumber,
				accountType);
	}

	@Override
	public List<CustomerAccountOverall> getAccountByFirstName(String firstName,
			String accountType) {
		return accountOverallDao.getAccountByFirstName(firstName, accountType);
	}

	@Override
	public List<CustomerAccountOverall> getAccoungByPhoneNumber(
			String phoneNumber, String accountType) {
		return accountOverallDao.getAccoungByPhoneNumber(phoneNumber,
				accountType);
	}

	@Override
	public List<CustomerAccountOverall> getAccountByAddress(String address,
			String accountType) {
		return accountOverallDao.getAccountByAddress(address, accountType);
	}

	@Override
	public List<CustomerAccountOverall> getAccountByAccountNumber(
			long accountNumber, String accountType) {
		return accountOverallDao.getAccountByAccountNumber(accountNumber,
				accountType);
	}

	@Override
	public List<CustomerAccountOverall> getAccountByEmail(String email,
			String accountType) {
		return accountOverallDao.getAccountByEmail(email, accountType);
	}

	@Override
	public List<CustomerAccountOverall> getAllAccountByIDCardNumber(
			long idCardNumber) {
		return accountOverallDao.getAllAccountByIDCardNumber(idCardNumber);
	}

	// end nghia

	@Override
	public List<CustomerAccountOverall> getActiveAccountByIDCardNumber(
			long idCardNumber, String accountType) {
		return accountOverallDao.getActiveAccountByIDCardNumber(idCardNumber,
				accountType);
	}
}
